home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9099 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c,comp.unix.programmer
  4. Subject: Re: Bus error
  5. Followup-To: comp.unix.programmer
  6. Date: 6 Mar 1996 21:14:23 -0800
  7. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  8. Message-ID: <4hlrbfINN81e@keats.ugrad.cs.ubc.ca>
  9. References: <DnuvJG.CA5@cdf.toronto.edu>
  10. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  11.  
  12. In article <DnuvJG.CA5@cdf.toronto.edu>,
  13. Lo Adley <a488load@cdf.toronto.edu> wrote:
  14.  >Hi, there,
  15.  >
  16.  >  Could you tell me what 'bus error' means?
  17.  
  18. A bus error means that the SIGBUS signal was raised in your program. On a
  19. UNIX system, this can be be caused by (but not limited to) any of following:
  20.  
  21.     - misaligned access to a word (usually caused by interpreting a
  22.       pointer to an object with relaxed alignment as a pointer to
  23.       an object with stricter alignment). E.g. casting a char * to an
  24.       int *, and then trying to read or write through that pointer.
  25.  
  26.     - calling raise(SIGBUS); to ``artificially'' raise the signal.
  27.  
  28.     - calling kill(<pid>, SIGBUS); from the current process or another
  29.       process, where <pid> is the process ID of your process to
  30.       artifically raise the signal.
  31.  
  32.       (I have seen an instance where a malicious user wrote a shell
  33.       script into another user's account while that other user was away
  34.       from this terminal. The script would pick randomly at the user's
  35.       processes that were running his programming project and send them
  36.       SIGSEGV signals, leading him to believe he had a bug).
  37.  
  38.     - accessing certain kinds of virtual memory pages can cause a SIGBUS.
  39.       For example, accessing a part of a memory mapped region which extends
  40.       past the end of the actual file object being mapped results in a
  41.       SIGBUS.
  42.  
  43. [ redirected to---guess where?---comp.unix.programmer ]
  44.  
  45.  
  46. redirected to comp.unix.programmer
  47. -- 
  48.  
  49.